﻿<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static', keyboard: !saving}">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #userForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="!editFlag">编辑</span>
                        <span *ngIf="editFlag">新建</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <tabset class="tab-container tabbable-line">
                        <tab heading="领用信息" customClass="m-tabs__item">
                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="taskNumber">任务号 *</label>
                                        <input id="taskNumber" #taskNumberInput="ngModel" type="text" name="unitOfUsing" class="form-control" [(ngModel)]="taskNumber" required  maxlength="256">
                                        <validation-messages [formCtrl]="taskNumberInput"></validation-messages>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="userName">审批人 *</label>
                                        <select  name="userId"  class="form-control"  [(ngModel)]="userId"  required>
                                            <option *ngFor="let optionItem of authorityUserOption" [value]="optionItem.userId">{{optionItem.userName}}</option>
                                        </select>
                                        <!--<input id="userName" #userNameInput="ngModel" type="text" name="belongToModel" class="form-control" [(ngModel)]="userName" required  maxlength="256">
                                        <validation-messages [formCtrl]="userNameInput"></validation-messages>-->
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="count">领用数量</label>
                                        <input id="count" #countInput="ngModel" type="number" name="count" class="form-control" [(ngModel)]="count" required  maxlength="256">
                                        <validation-messages [formCtrl]="countInput"></validation-messages>
                                    </div>
                                </div>
                            </div>
                        </tab>
                    </tabset>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{"Cancel" | localize}}</button>
                    <button  type="submit" class="btn btn-primary" [disabled]="!userForm.form.valid" [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i>
                        <span>{{"Save" | localize}}</span></button>
                </div>
            </form>
        </div>
    </div>
</div>